using System;
using System.Data;
using System.Data.OleDb;

namespace Net.SamuelChen.Libs.Data.Database {
    public class OleDBQuery : Query {
        protected override IDbConnection CreateConnection() {
            return new OleDbConnection();
        }

        protected override IDataAdapter CreateAdapter(IDbCommand selectCommand) {
            return new OleDbDataAdapter((OleDbCommand)selectCommand);
        }

        public override IDbCommand CreateCommand() {
            return new OleDbCommand();
        }

        public override IDataParameter CreateParameter(string parameterName, object value) {
            return new OleDbParameter(parameterName, value);
        }

        public override IDataParameter CreateParameter(string parameterName, object value, ParameterDirection direction) {
            IDataParameter parm = new OleDbParameter(parameterName, value);
            parm.Direction = direction;
            return parm;
        }
    }
}
